home *** CD-ROM | disk | FTP | other *** search
- <?php
- ////////////////////////////////////////////////////////////////////////////////
- // <!--Copyright (c) 2005 Pure Networks Inc. All rights reserved.-->
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Build: 3.0.6121.0 (Stable)
- // $Revision: #3 $
- //
- ini_set ( "zlib.output_compression", "Off" );
- ini_set ( "max_execution_time", "0" );
- $sNavLocation = "upload";
- require "_session_common.php";
-
- ///////////////////////////////////////////////////
- // Make sure that we have a valid share passed in.
- ///////////////////////////////////////////////////
- if (!isset($_GET['share']) or $_GET['share'] == "")
- {
- log_activity("QS check", "failure", return_error_text(200, "", $arErrors));
- gotoAbs('/error/200/return');
- exit();
- }
- else
- {
- $sShare = $_GET['share'];
- log_activity("view folder share", "info", $sShare);
- }
- ///////////////////////////////////////////////////
- // Make sure that we have a valid path passed in.
- ///////////////////////////////////////////////////
- if (!isset($_GET['path']) or $_GET['path'] == "")
- {
- log_activity("QS check", "failure", return_error_text(201, "", $arErrors));
- gotoAbs('/error/201/return');
- exit();
- }
- else
- {
- $sPath = urlDecodeString($_GET['path']);
- log_activity("view folder path", "info", $sPath);
- }
- ///////////////////////////////////////////////////
- // Let's try to see if we can open the share
- ///////////////////////////////////////////////////
- try
- {
- $nmSharedPlace = $nmNetworkLib->OpenShare($sShare);
- }
- catch(Exception $ex)
- {
- log_activity("Attempting nmNetworkLib->OpenShare($sShare)", "exception", $ex->getMessage());
- gotoAbs('/error/305/return');
- exit();
- }
- ///////////////////////////////////////////////////
- // check to ensure upload is enabled.
- ///////////////////////////////////////////////////
- try
- {
- $bReadOnly = $nmSharedPlace->ReadOnly;
- $bUploadEnabled = $nmRaManager->UploadsEnabled;
- if ($bReadOnly)
- {
- log_activity("upload", "error", return_error_text(328, "", $arErrors));
- goto('upload.php?errorcode=328&share=' . $sShare . '&path=' . $sPath);
- exit();
- }
- if (!$bUploadEnabled)
- {
- log_activity("upload", "error", return_error_text(327, "", $arErrors));
- goto('upload.php?errorcode=327&share=' . $sShare . '&path=' . $sPath);
- exit();
- }
-
- }
- catch (exception $ex)
- {
- log_activity("Attempting nmRaManager->UploadsEnabled", "exception", $ex->getMessage());
- goto('upload.php?errorcode=307');
- exit();
- }
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html>
- <head>
- <title><?php echo htmlspecialchars(returnPageTitle($sIntroHeadline, $sProductNameInformal, $nmSharedPlace, $sPath, $fileName)); ?></title>
- <?php
- require "_styles_import.php";
- ?>
- <script type="text/javascript" language="JavaScript">
- function upload_status()
- {
- if (document.getElementById('userfile').value == "")
- {
- // they haven't picked a file, they have to browse first...
- }
- else
- {
- if (verify_file_is_valid())
- {
- document.getElementById('Form1').submit();
- document.getElementById('UploadTable').style.display='none';
- document.getElementById('UploadTable').style.visibility='hidden';
- document.getElementById('UploadHR').style.visibility='hidden';
- document.getElementById('FileDialog').style.visibility='hidden';
- document.getElementById('UploadStep2').style.visibility='visible';
- return true;
- }
- else
- {
- return false;
- }
- }
- }
-
- function verify_file_is_valid()
- {
- sDisallowedExtensions = ("<?php echo ($sincDisallowedExtensions); ?>");
- // let's get the file's extension
- var str1 = document.getElementById('userfile').value.toLowerCase();
- iPos = str1.lastIndexOf(".");
- sFileExtension = str1.substr(iPos);
-
- // is the extension of a disallowed type?
- if (sDisallowedExtensions.indexOf(sFileExtension) >= 0)
- {
- alert ('<?php echo (return_error_text(324, "", $arErrors)); ?>');
- <?php
- if ($btBrowserType != "macosxie")
- {
- ?>
- document.getElementById('BrowseInput').value = '';
- check_upload_button_enabled_state()
- return false;
- <?php
- }
- ?>
- }
- else
- {
- <?php
- if ($btBrowserType != "macosxie")
- {
- ?>
- document.getElementById('BrowseInput').value = document.getElementById('userfile').value;
- var iLastSlashIndex = document.getElementById('userfile').value.lastIndexOf("\\");
- var strFileName = document.getElementById('userfile').value.substr(iLastSlashIndex + 1);
- document.getElementById('BrowseResults').innerHTML = "File to upload: " + strFileName;
- check_upload_button_enabled_state();
- <?php
- }
- ?>
- return true;
- }
- }
- </script>
- </head>
- <?php
- if ($btBrowserType != "macosxie")
- {
- ?>
- <body style="clip: rect(0px, 0px, 0px, 0px); overflow:hidden;" class="UploadBody">
- <!--Copyright (c) 2005 Pure Networks Inc. All rights reserved.-->
- <?php
- }
- else
- {
- ?>
- <body>
- <!--Copyright (c) 2005 Pure Networks Inc. All rights reserved.-->
- <?php
- }
- ?>
-
- <table width="100%" border="0">
- <tr>
- <td valign="top">
- <!--Main Content Starts Here-->
- <?php
- require "styles/default/default.inc";
-
- if ($btBrowserType != "macosxie")
- {
- ?>
- <script type="text/javascript">
- function verify_file_is_picked()
- {
- if (document.getElementById('BrowseInput').value != "")
- {
- return true;
- }
- else
- {
- return false;
- }
- }
-
- function check_upload_button_enabled_state()
- {
- if (verify_file_is_picked())
- {
- document.getElementById('upload').className='Button UploadButton';
- }
- else
- {
- document.getElementById('upload').className='ButtonDisabled UploadButton';
- }
- }
-
- function upload_mouse_out()
- {
- if (verify_file_is_picked())
- {
- document.getElementById('upload').className='Button UploadButton';
- }
- else
- {
- document.getElementById('upload').className='ButtonDisabled UploadButton';
- }
- }
-
- function upload_mouse_over()
- {
- if (verify_file_is_picked())
- {
- document.getElementById('upload').className='ButtonOver UploadButton';
- }
- else
- {
- document.getElementById('upload').className='ButtonDisabled UploadButton';
- }
- }
- </script>
- <div class="UploadTable" id="UploadTable" style="visibility:visible;">
- <form id="Form1" name="Form1" method="post" runat="server" enctype="multipart/form-data" action="upload.php" onsubmit="return upload_status();">
- <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo ($iMaxFileSize); ?>"/>
- <input type="hidden" name="SHARE" value="<?php echo $sShare; ?>"/>
- <input type="hidden" name="page" value="<?php echo $_GET['page'];?>">
- <input type="hidden" name="PATH" value="<?php echo urlEncodeString($sPath); ?>"/>
- <label for="userfile"><div class="UploadFormHeader">Select a File to Upload to Your Network</div></label><br/>
- <div class="UploadFormText" id="BrowseResults" name="BrowseResults">Click <strong>Browse</strong>, and select a file.</div>
- <div class="UploadHR" id="UploadHR" style="visibility:visible;"> </div>
- <input type="hidden" name="BrowseInput" id="BrowseInput" class="BrowseInput" size="48" onchange="check_upload_button_enabled_state();"/>
- <div style="position:relative;visibility:visible;" id="FileDialog">
- <input name="userfile" id="userfile" type="file" class="FileBrowseControl" size="1" onmouseover="document.getElementById('browse').className='ButtonOver BrowseButton'" onmouseout="document.getElementById('browse').className='Button BrowseButton'" onchange="verify_file_is_valid();"/>
- <div name="browse" id="browse" class="BrowseButton Button" onmouseover="this.className='BrowseButton ButtonOver'" onmouseout="this.className='BrowseButton Button'"> Browse... </div>
- <a id="upload" class="UploadButton ButtonDisabled" onmouseover="upload_mouse_over();" onmouseout="upload_mouse_out();" href="javascript:upload_status();">Upload</a>
- <input type="submit" name="upload" value="Upload " style="position:relative; left:-250px;"/>
- </div>
- </form>
- </div> <!-- end of Upload Table div -->
- <?php
- }
- else
- {
- ?>
- <div class="UploadTable" id="UploadTable" style="visibility:visible;">
- <form id="Form1" name="Form1" method="post" runat="server" enctype="multipart/form-data" action="upload.php" onsubmit="return upload_status();">
- <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo ($iMaxFileSize); ?>"/>
- <input type="hidden" name="SHARE" value="<?php echo $sShare; ?>"/>
- <input type="hidden" name="page" value="<?php echo $_GET['page'];?>">
- <input type="hidden" name="PATH" value="<?php echo urlEncodeString($sPath); ?>"/>
- <label for="userfile"><div class="UploadFormHeader">Select a File to Upload to Your Network</div></label><br/>
- <div class="UploadFormText">Click <strong>Browse</strong>, and select a file.</div>
- <div class="UploadHR" id="UploadHR" style="visibility:visible;"> </div>
- <div style="position:relative;visibility:visible;" id="FileDialog">
- <input name="userfile" id="userfile" type="file" size="15" class="FileBrowseControlMacIe" />
- <input type="submit" name="upload" value="Upload " "/>
- </div>
- </form>
- <br/><br/>
- </div> <!-- end of Upload Table div -->
- <?php
- }
- ?>
- <div class="UploadSetupTable" id="UploadStep2" style="visibility:hidden;display:inline;">
- <div class="UploadStatusHeader">Uploading file to your network</div>
- <br/><br/><div class="UploadStatusText">Please wait...</div>
- </div>
- <!-- Main content ends here -->
- </td>
- </tr>
- </table>
- </body>
- </html>